//
//  ShoppingCategoryResponse.m
//  EasyToo
//
//  Created by zhengzhe on 13-9-10.
//
//

#import "ShoppingCategoryResponse.h"
#import "ShoppingCategory.h"

@implementation ShoppingCategoryResponse

- (void)parse
{
    [super parse];
    
    if (self.bodyDict)
    {
        self.categoryArray = [[NSMutableArray alloc] init];
        
        NSArray *JsonArray = GetDictionaryArrayDefaultNil(self.bodyDict, @"goods");
        for (int i = 0; i < [JsonArray count]; i++)
        {
            NSDictionary *jsonDict = [JsonArray objectAtIndex:i];
            ShoppingCategory *category = [[ShoppingCategory alloc] initWithDictionary:jsonDict];
            
            [self.categoryArray addObject:category];
            
            [category release];
        }
    }
}

- (void)dealloc
{
    self.categoryArray = nil;
    [super dealloc];
}

@end
